import { Component, OnInit } from '@angular/core';
import { DicKeyListComponent } from "./dic-key-list/dic-key-list.component";
import { BladeService } from "../../../shared/blade.service";
import { Blade } from "../../../shared/blade/blade.model";
import { BladeData } from "../../../shared/blade/blade-data";
import { ToolbarService } from "../../../shared/toolbar.service";
import { SetofkeyService } from "../../../service/setofkey.service";
import { DialogService } from "../../../shared/dialog.service";
import { Observable } from "rxjs/Observable";
import { BladeContainerInterface } from "../../../shared/blade/blade-container.interface";


@Component({
  selector: 'app-dic',
  templateUrl: './dic.component.html',
  styleUrls: ['./dic.component.css'],
  providers: [BladeService]
})
export class DicComponent implements OnInit {
  /**
   * 当前弹出层
   * 
   * @type {Blade}
   * @memberof BladeContainerInterface
   */
  currentBlade: Blade;

  constructor(
    public bladeService: BladeService,
  ) {

  }

  ngOnInit() {
    this.createDicKeyListBlade()
  }


  /**
   * 创建数据字典列表弹出层
   * 
   * 
   * @memberof DicComponent
   */
  createDicKeyListBlade() {
    let data: BladeData = new BladeData();
    data.id = "dicKeyList";
    data.title = "数据字典键";
    data.subtitle = "数据字典键列表";
    data.isClosingDisabled = true;
    this.currentBlade = this.bladeService.createBlade(DicKeyListComponent, data);
    this.bladeService.showBlade(this.currentBlade);
  }
  /**
   * 是否可以离开
   * 
   * 
   * @memberof DicComponent
   */
  canDeactivate(): boolean | Observable<boolean> | Promise<boolean> {
    return true;
  }

}



// WEBPACK FOOTER //
// ./src/app/module/basic/dic/dic.component.ts